<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<jsp:useBean id="player" class="pe.lucene.web.myrating.Player" scope="session"/>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="pe.lucene.web.myrating.HibernateUtil"%>
<%@page import="org.hibernate.Session"%>
<%@page import="org.hibernate.Criteria"%>
<%@page import="pe.lucene.web.myrating.Rating"%>
<%@page import="org.hibernate.criterion.Order"%>
<%@page import="java.util.List"%>
<%@page import="org.hibernate.Query"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<link rel="stylesheet" type="text/css" href="../index.css" />
<link rel="stylesheet" type="text/css" href="../table.css" />
<link rel="stylesheet" type="text/css" href="../input.css" />
<title>Rating List</title>
</head>
<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <!-- title -->
    <tr background="../image/back_titlebar.png" height="30">
        <td >MyRating</td>
        <td align="right">ver 0.1</td>
    </tr>
    <!-- Decoration empty bar -->
    <tr>
        <td colspan="2" height="2" bgcolor="#959aa0"></td>
    </tr>
<%
Session hbSession = HibernateUtil.currentSession();

Query query = hbSession.createQuery("from Rating where player = :id order by num desc");
query.setParameter("id", player.getId());

List list = query.list();

for (int i=0; i < list.size(); i++) {
	Rating rating = (Rating) list.get(i);
	%><tr><td colspan="2"><%
	out.println(rating.getNum() + "/" + rating.getRating() + "/" + rating.getDate() + "<BR>");
	%></td></tr><%
}
%>
</table>

</body>
</html>